import { setupRouter, router } from '@/router';
import pinia from '@/store';
import { setupErrorHandle } from 'vc/src/store/error-log';
import { createApp } from 'vue';
import App from './App.vue';
import { initApplication } from './init-application';
import { registerGlobalDirectiveForWeb } from '@vc/directives';
import './styles';

import VXETable from 'vxe-table';
import 'vxe-table/lib/style.css';

(async() => {
  const app = createApp(App);

  app.use(VXETable);
  app.use(pinia);
  
  await initApplication(app);
  
  await setupRouter(app);
  registerGlobalDirectiveForWeb(app);
  // setupErrorHandle(app, router);
  
  app.mount('#app');
})();
